<template>
	<view class="rounded-lg bg-white p-20 mb-30">
		<postCompVue :post="val" :type="1" @click="handleGoDetail(val)"></postCompVue>
		<!--  -->
		<!-- <view class="">
			<view class="flex p-10 justify-between h-[100rpx] mt-20 items-center">
				<view class="flex items-center">
					<view class="w-[80rpx] h-[80rpx] rounded-full overflow-hidden">
						<ImageBoxVue :src="'/static/imgs/img1.png'"></ImageBoxVue>
					</view>
					<view class="flex flex-col ml-20">
						<view class="flex items-center">
							<text class="text-sm font-bold">{{'小张'}}</text>
							<view class="bg-[#D7F0FF] p-4 ml-10">
								<text class="text-[#3689C6]">{{'卡牌师'}}</text>
							</view>
						</view>
						<text class="mt-10">下个月要注意关注...</text>
					</view>
				</view>
				<view class="flex flex-col">
					<view class="flex items-center justify-end">
						<ImageBoxVue src="/static/icons/msg.png" width="32rpx" height="32rpx"></ImageBoxVue>
						<text class="ml-10 text-[#416279]">99+</text>
					</view>
					<text class="text-[#329EFF] mt-10">3钻解锁98字内容</text>
				</view>
			</view>
		</view> -->
	</view>
</template>

<script setup>
	import {
		ref,
		provide,
	} from 'vue';
	import postCompVue from '@/components/postComp.vue';
	const {
		val
	} = defineProps(['val'])
	const emit = defineEmits(['onReply'])
	
	provide('val', val)
	
	const isAch = ref(0)
	isAch.value = uni.getStorageSync('user').ach
	
	const handleGoDetail = (val) => {
		if (val.sec == 1 && isAch.value != 1) {
			return
		}
		uni.navigateTo({
			url: `/pages/community/postDetail?id=${val.id}`
		})
	}
	
	const onReply = (val) => {
		emit('onReply', val)
	}
</script>

<style lang="scss" scoped>
.box-model {
	align-items: stretch;
	.item {
		&:nth-child(3n) {
			margin-right: 0;
		}
	}
}
</style>